package com.yunji.ylexpiration.service.impl;

import com.yunji.ylexpiration.entity.FurnClassificationtype;
import com.yunji.ylexpiration.entity.FurnClassificationtypeExample;
import com.yunji.ylexpiration.mapper.FurnClassificationtypeMapper;
import com.yunji.ylexpiration.service.FurnClassificationtypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class FurnClassificationtypeServiceImpl implements FurnClassificationtypeService {

    @Autowired
    private FurnClassificationtypeMapper furnClassificationtypeMapper;


    @Override
    public FurnClassificationtype selectByparentIdByid(Integer id) {
        if(id==0){
            return null;
        }
        FurnClassificationtypeExample example = new FurnClassificationtypeExample();
        FurnClassificationtypeExample.Criteria criteria = example.createCriteria();
        criteria.andIdEqualTo(id);
        List<FurnClassificationtype> furnClassificationtypes = furnClassificationtypeMapper.selectByExample(example);
        return furnClassificationtypes.get(0);
    }

}
